package com.example.listossimage.死锁案例;

import org.junit.Test;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;

public class RedisLock {

    private StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();

    RedisTemplate redisTemplate = new RedisTemplate();

    JedisConnectionFactory factory = new JedisConnectionFactory();

    public void init() {
    }



    @Test
    public void test() {
        stringRedisTemplate.opsForValue().set("1", "1");
        stringRedisTemplate.delete("1");
    }
}
